<template>
	<view class="container">
		<uni-nav-bar left-icon="left" :title="title" @clickLeft="backClick" background-color="#007AFF" dark="true"></uni-nav-bar>
		<uni-card :title="homework.title" :extra="homework.statusText" :sub-title="homework.deadline">
			<text>{{homework.content}}</text>
		</uni-card>
		<view class="vcbox">
			<uni-file-picker limit="1" file-mediatype="all" file-extname="docx" title="最多选择1个文档"></uni-file-picker>
			<button type="primary" @click="uploadFile">提交作业</button>
		</view>
	</view>
</template>
<script type="text/javascript">
export default 
     {
        data() {
            return {
                title: '作业详情',
                homework: {
                    homeworkId: 1,
                    title: '作业1',
                    content: '作业1的内容',
                    deadline: '2021-09-01',
                    status: '',
                    statusText: '未提交'
                }
            }
        },
        onLoad(options) {
            this.homeworkId = options.homeworkId;
        },
        methods: {
            backClick() {
                uni.navigateBack();
            },
            menuClick(item) {
                console.log('item', item);
            },
            homeworkClick(item, homeworkId) {
                uni.navigateTo({
                    url: '/pages/homework/homework_detail?homeworkId=' + homeworkId
                });
            },
        },
    }
</script>
<style type="text/css">.container{display: flex !important;flex-direction: column}.content{display: flex !important;flex-direction: column;align-items:center;justify-content:center}.title{font-size:36rpx;color:#8f8f94}.vcbox{display: flex !important;flex-direction: column;align-items:center;justify-content:center;margin:15px;padding-left:10px;padding-right:10px}</style>